Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/propagation-utils

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/propagation-utils

Propagation utilities for opentelemetry instrumentations

  • 0.30.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
477K
decreased by-54.55%
Maintainers
3
Weekly downloads
 
Created
Source

OpenTelemetry Propagation Utils

NPM Published Version Apache License

A collection of propagation utils for opentelemetry.

Install

npm install --save @opentelemetry/propagation-utils

Usage

PubSub

To make sure each message handled by pubsub creates a new process span, and propagates to any internal operation, do as follow:

import { pubsubPropagation } from '@opentelemetry/propagation-utils';
import { Span, propagation, trace, Context } from '@opentelemetry/api';

const patch = (message: Message[], rootSpan: Span) => {
    const tracer = trace.getTracer('my-tracer');
    pubsubPropagation.patchArrayForProcessSpans(messages, tracer);

    pubsubPropagation.patchMessagesArrayToStartProcessSpans<Message>({
        messages,
        tracer,
        parentSpan: rootSpan,
        messageToSpanDetails: (message) => ({
            attributes: { ... },
            name: 'some-name',
            parentContext: propagation.extract(....) as Context
        }),
    });
}

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc